﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<TemplateWeb.Models.ViewModels.GroupViewModel>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
    <link rel="stylesheet" type="text/css" href="../../Content/HomeCSS/style.css" />
    <div class="content_panel">
        <div class="box_center">
            <div class="title">
                <span>
                    <%= Model.SachModel.GetModel.LstObjModel[0].LoaiSach.TenLoaiSach %></span><div class="bg">
                        <img src="../../Content/Images/Home/bg_title_right.png"></div>
            </div>
            <div class="content">
                <table border="0" cellpadding="0" cellspacing="5" width="100%" align="center">
                    <tbody>
                        <tr>
                            <td>
                                <div class="list_item">
                                    <div class="img">
                                        <img src="../../Content/Images/Items/<%= Model.SachModel.GetModel.LstObjModel[0].HinhMinhHoa %>"
                                            alt="<%= Model.SachModel.GetModel.LstObjModel[0].TenSach %>" width="114" height="151" />
                                    </div>
                                    <div class="text">
                                        <span class="name">
                                            <%= Model.SachModel.GetModel.LstObjModel[0].TenSach %></span><br>
                                        <p>
                                            Số trang:
                                            <%= Model.SachModel.GetModel.LstObjModel[0].SoTrang %>.</p>
                                        <p>
                                            Khổ:
                                            <%= Model.SachModel.GetModel.LstObjModel[0].Kho %></p>
                                        <p>
                                            Giá:
                                            <%= string.Format("{0:0,0}", Model.SachModel.GetModel.LstObjModel[0].Gia.Value)%>đ</p>
                                        <p>
                                            Phát hành:
                                            <%= Model.SachModel.GetModel.LstObjModel[0].NhaXuatBan %></p>
                                        <p>
                                            Tác giả:
                                            <%= Model.SachModel.GetModel.LstObjModel[0].TacGia%></p>
                                        <br />
                                        <a href="<%= Url.Action("AddToCart", "Home", new { id = Model.SachModel.GetModel.LstObjModel[0].ID, idloaisach = Model.SachModel.GetModel.LstObjModel[0].IDLoaiSach })%>">
                                            <img src="../../../Content/Images/Home/shopNow.png" alt="Shop Now" />
                                        </a>
                                    </div>
                                </div>
                                <div class="rating">
                                    <% using (Html.BeginForm("InsertDanhGia", "Home", FormMethod.Post))
                                       {
                                           var point = WebConfiguration.RetrievePoint(Model.SachModel.GetModel.LstObjModel[0]);
                                           var star = WebConfiguration.RetrievStar(point);
                                    %>
                                    Đánh giá:
                                    <img src="../../Content/Images/Home/<%= star %>"><br>
                                    <% if (Request.IsAuthenticated)
                                       { %>
                                    <label for="rating_3">
                                        <input id="rating_3" type="radio" value="2" name="DanhGia_Diem">Rất dở</label>
                                    <label for="rating_2">
                                        <input id="rating_2" type="radio" value="4" name="DanhGia_Diem">Dở</label>
                                    <label for="rating_4">
                                        <input id="rating_4" type="radio" value="6" name="DanhGia_Diem">Bình thường</label>
                                    <label for="rating_5">
                                        <input id="rating_5" type="radio" value="8" name="DanhGia_Diem">Hay</label>
                                    <label for="rating_1">
                                        <input id="rating_1" type="radio" value="10" name="DanhGia_Diem">Rất hay</label>
                                    <input type="hidden" name="DanhGia_IDSach" value="<%= Model.SachModel.GetModel.LstObjModel[0].ID %>" />
                                    <input type="submit" name="sbt" id="sbt" value="Chọn" />
                                    <% } %>
                                </div>
                                <% } %>
                            </td>
                        </tr>
                        <tr>
                            <td style="height: 10px;">
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <%= Model.SachModel.GetModel.LstObjModel[0].NoiDung %>
                            </td>
                        </tr>
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</asp:Content>
